package fr.paulmasson.jfreex.utils;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;

public class Wget {
	
	public static String wget (String url)  throws MalformedURLException, IOException {
		System.out.println("Get");
		URLConnection urlConnection = new URL(url).openConnection();
		urlConnection.connect();
		Scanner scanner = new Scanner(urlConnection.getInputStream());
		StringBuffer source = new StringBuffer();
		while (scanner.hasNextLine()) {
			source.append(scanner.nextLine()+"\n");
		}
		scanner.close();
		return source.toString();
		
	}

}
